import json

def get_post_body(request):
    # post 兼容post请求body内容不同格式
    params = dict()
    body = request.body
    posts = request.POST.dict()
    params.update(posts)
    if (not params) and body:
        body_data = json.loads(body)
        params.update(body_data)
    return params